package com.luyu.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.luyu.entity.UserRole;
import com.luyu.mapper.UserRoleMapper;
import com.luyu.service.UserRoleService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

@Service
public  class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> implements UserRoleService {

    @Override
    public List<Long> listIdListByUserId(Long id) {
        return this.lambdaQuery().eq(UserRole::getUserId,id).list().stream().map(item->item.getRoleId()).collect(Collectors.toList());
    }

}
